package ywh.ui
{
	import fl.controls.listClasses.ImageCell;
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	/**
	 * ...
	 * @author 杨伟华
	 */
	public class MyPhotoCell extends ImageCell
	{
		var mark:DisplayObject;
		private static var defaultStyles:Object = {
				imagePadding:3,
				upSkin:"Cell_Skin",downSkin:"Cell_Skin",overSkin:"Cell_Skin",
				disabledSkin:"Cell_Skin",
				selectedDisabledSkin:"CellSelected_skin",
				selectedUpSkin:"CellSelected_skin",selectedDownSkin:"CellSelected_skin",selectedOverSkin:"CellSelected_skin",
				selectedmarkSkin:"CellSelected_mark",
				textPadding:5
			};
		public static function getStyleDefinition():Object
		{
			return mergeStyles(defaultStyles, ImageCell.getStyleDefinition());
		}
		
		public function MyPhotoCell()
		{
			super ();
		}
		override protected function drawBackground():void
		{
			super.drawBackground();
			if (!mark) {
				mark = getDisplayObjectInstance(getStyleValue("selectedmarkSkin"));
				mark.x = width / 2;
				mark.y = 15;
			}
			if (selected) {				
				addChild(mark);
			}
			else
			{
				mark.parent&&removeChild(mark);
			}
		}
	}
}